﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _180FrameWork.Common
{
    public class MyStringHelper
    {

        /// <summary>
        /// 去除字符串中的空格 回车 换行 制表符 create by dkw
        /// </summary>
        /// <param name="str_telephone"></param>
        /// <returns></returns>
        public static string TrimAll(string str)
        {
            return str.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r\n", "").Replace("\r", "");
        }

        /// <summary>
        /// 去除字符结尾串中的空格 回车 换行 制表符 create by dkw
        /// </summary>
        /// <param name="str_telephone"></param>
        /// <returns></returns>
        public static string TrimRight(string str)
        {
            char[] mychar ={' ','\r','\n','\t'};
            return str.TrimEnd(mychar);
        }

        /// <summary>
        /// 去除字符串开始中的空格 回车 换行 制表符 create by dkw
        /// </summary>
        /// <param name="str_telephone"></param>
        /// <returns></returns>
        public static string TrimStart(string str)
        {
            char[] mychar = { ' ', '\r', '\n', '\t' };
            return str.TrimStart(mychar);
        }

    }
}
